public class Test5 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Animal ani = new Animal();
		ani.name = "Teg";
		ani.type = "dog";
		ani.age = 3;
		System.out.println(ani.name + " is " + ani.type + " and he " + ani.age + " old");
		for (int i = 0; i < 10; i++) {
			ani.birthday();
			System.out.println(ani.name + " is " + ani.type + " and he " + ani.age + " old");
	
		}
		
	}

}

class Animal{
	String name, type;
	int age;
	
	void birthday(){
		age++;
		if (age >= 10 && !type.substring(0,3).equals("old") ){
			type = "old" + type;
		}
	}
}